package com.xx.ch05.demo.demo02.service;

import com.xx.ch05.demo.demo01.dao.UserDao;
import com.xx.ch05.demo.demo01.entity.User;
import com.xx.ch05.demo.demo01.service.UserService;
import com.xx.ch05.demo.demo02.text.UserFactory;

/**
 * @author 许欣
 * 时间：2022/4/11 14:25
 * 描述：
 */
public class UserServiceImpl implements UserService {
    //实例化所依赖的UserDao对象
    //private UserDao dao=new UserDaoImpl();
    private UserDao dao= UserFactory.getInstance();
    @Override
    public void save(User user) {
        //调用UserDao的方法保存用户信息
        dao.save(user);
    }
}
